fn main() {

    let mut uv = vec![20, 30, 40];

    for e in 0..uv.len(){
        uv[e] += 10;
    }
    println!("{:?}", uv);

    let names:Vec<&str> = vec!["bei.liu", "yu.guan", "yun.zhao"];
    // names.append("fei.zhang");
    for ii in 0..names.len() {
        println!("{}", names[ii]);
    }

    let mut nums = vec![1, 3, 5, 7];
    nums.push(9);
    for z in 0..nums.len(){
        println!("{}", nums[z]);
    }

    for c in &nums{
        println!("{}", c);
    }

    println!("{:?}", nums.get(20));

    // println!("{:?}", nums[20]);
    // 上述语句中，尝试通过下标读取不存在的元素会发生系统级panic

    let mut v = vec![1, 2, 3, 4, 5];
    v.push(6);

    let first = &v[0];
    println!("The first element is: {}", first);
}
